local open = io.open
local getfenv = getfenv
local setmetatable = setmetatable
local find = string.find
local format = string.format

log = nil
module("log")

local file

function print(s, ...)
	if find(s, "%", nil, true) then
		s = format(s, ...)
	end
	if not file then
		file = open("FrameXML.log", "w")
	end
	file:write(s.."\n")
end

setmetatable(getfenv(), { __call = function (_, ...) print(...) end })
